package lab01;
public class Test06 {
    public static void main(String[] args) {
        //if-else
        int score=3;
        String str="不及格";
        if(score==1) {
            str= "不及格";
        }
        else if(score==2) {
            str= "及格";
        }
        else if(score==3){
            str="中等";
        }
        else if(score==4){
            str="良好";
        }
        else if(score==5){
            str="优秀";
        }
        System.out.println("成绩为"+str);
//switch
        int grade=2,n=0;
        String st="";
        n=grade/1;
        switch(n)
        {
            case 1:
                st="不及格";
                break;
            case 2:
                st="及格";
                break;
            case 3:
                st="中等";
                break;
            case 4:
                st="良好";
                break;
            case 5:
                st="优秀";
                break;
        }
        System.out.println("成绩"+grade+"的等级为"+st);
    }
}
